﻿using System;
using System.Collections.Generic;

namespace gvPoco.ChartOptions
{
    public class PieChart : BaseOptions
    {

        /// <summary>
        /// An array of objects, each describing the format of the corresponding slice 
        /// in the pie. If a slice or a value is not specified, the global value will be 
        /// used. Each object supports the following properties: color and textStyle
        /// </summary>
        public List<Slice> slices { get; set; }

        /// <summary>
        /// The color of the slice borders. Only applicable when the chart is two-dimensional.
        /// </summary>
        public string pieSliceBorderColor { get; set; }

        /// <summary>
        /// The content of the text displayed on the slice. 
        /// Can be one of the following: percentage, value, label, none
        /// </summary>
        public string pieSliceText { get; private set; }

        /// <summary>
        /// An object that specifies the slice text style.
        /// </summary>
        public TextStyle pieSliceTextStyle { get; set; }
        
        /// <summary>
        /// If set to true, will draw slices counterclockwise. The default is to draw clockwise.
        /// </summary>
        public bool reverseCategories { get; set; }

        /// <summary>
        /// The slice relative part, below which a slice will not show individually. All slices 
        /// that have not passed this threshold will be combined to a single slice, whose size 
        /// is the sum of all their sizes. Default is not to show individually any slice which 
        /// is smaller than half a degree.
        /// </summary>
        public double sliceVisibilityThreshold { get; set; }

        /// <summary>
        /// Color for the combination slice that holds all slices below sliceVisibilityThreshold.
        /// </summary>
        public string pieResidueSliceColor { get; set; }

        /// <summary>
        /// A label for the combination slice that holds all slices below sliceVisibilityThreshold.
        /// </summary>
        public string pieResidueSliceLabel { get; set; }

        public PieChart()
        {
            chartType = "Pie Chart";
            slices = new List<Slice>();
            pieSliceTextStyle = new TextStyle();
            sliceVisibilityThreshold = (1 / 720);
            pieResidueSliceColor = "#CCC";
            pieResidueSliceLabel = "Other";
        }
    }
}